using System;

namespace KodeIT.Web
{
    /// <summary>
    /// This class represents the event raised by IIS when it is preprocessing a request's headers. If your HttpFilter should 
    /// be notified for this event, it should subscribe for the <see cref="IFilterEvents.PreProcHeaders"/> or
    /// the <see cref="IFilterEvents.AuthComplete"/> events.
    /// </summary>
    /// <remarks>
    /// The key difference between the <see cref="IFilterEvents.PreProcHeaders"/> and the 
    /// <see cref="IFilterEvents.AuthComplete"/> events is that the <see cref="IFilterEvents.AuthComplete"/> event 
    /// occurs after the client's identity has been negotiated with the client. Because of the notification's timing, 
    /// the AUTH_USER server variable can be used to reliably obtain the identity of the user. Also, functionality is 
    /// provided to access the identity that IIS impersonates when processing the request.
    /// </remarks>
    public class RequestHeadersEvent : HeadersEvent
    {
        internal RequestHeadersEvent(NativeContext nativeContext)
            : base(nativeContext)
        {
        }

        /// <summary>
        /// Gets or sets the http method sent by the client.
        /// </summary>
        public string Method
        {
            get { return Headers[HttpHeader.Method]; }
            set { Headers[HttpHeader.Method] = value; }
        }

        /// <summary>
        /// Gets or sets the http url sent by the client.
        /// </summary>
        public string Url
        {
            get { return Headers[HttpHeader.Url]; }
            set { Headers[HttpHeader.Url] = value; }
        }

        /// <summary>
        /// Gets or sets the http version sent by the client.
        /// </summary>
        public string Version
        {
            get { return Headers[HttpHeader.Version]; }
            set { Headers[HttpHeader.Version] = value; }
        }
    }
}
